package com.linkai.基础._01_copy;

/**
 * @Description: 引用拷贝
 *                参考：https://blog.csdn.net/riemann_/article/details/87217229
 * @Author: 林凯
 * @Date: 2021/10/29 23:14
 */
public class _01_QuoteCopy {
    public static void main(String[] args) {
        Teacher t1 = new Teacher("JackLin", 21);
        Teacher t2 = t1;
        System.out.println(t1);
        System.out.println(t2);
    }
}

class Teacher {
    private String name;
    private int age;

    public Teacher(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
